<!-- File: /app/View/Users/index.ctp -->

<h1>Usuarios</h1>
<p><?php echo $this->Html->link('Añadir usuario', array('action' => 'add')); ?></p>
<table>
    <tr>
        <th>Id</th>
        <th>UserName</th>
    </tr>
<!-- Here's where we loop through our $posts array, printing out users info -->
    <?php foreach ($users as $user): ?>
    <tr>
        <td><?php echo $user['User']['id']; ?></td>
        <td>
        <?php echo $this->Html->link($user['User']['username'], array('action' => 'view', $user['User']['id']));?>
        </td>
        <td>
        <?php echo $this->Form->postLink(
            'Borrar',
            array('action' => 'delete', $user['User']['id']),
            array('confirm' => '¿Estás seguro?'));
        ?>
        </td>
        
    </tr>
    <?php endforeach; ?>

</table>